Test-Series - programming logic

Test Number 3/15

Q: A language has 28 different letters in total. Each word in the language is composed of maximum 7 letters. You want to create a data-type to store a word of this language. You decide to store the word as an array of letters. How many bits will you assign to the data-type to be able to store all kinds of words of the language.
A. 16
B. 35
C. 196
D. 17
Solution: The correct answer is:
35
Q: Is there any difference between the following declarations?

1 : extern int fun();
2 : int fun();
A. int fun(); is overrided with extern int fun();
B. None of these
C. No difference, except extern int fun(); is probably in another file
D. Both are identical
Solution: The correct answer is:
No difference, except extern int fun(); is probably in another file
Q: Which of the following is NOT a function of a loader?
A. loading
B. translation
C. relocation
D. allocation
Solution: The correct answer is “translation” is not a function of a loader.

Loader is the program of the operating system which loads the executable from the disk into the primary memory(RAM) for execution. It allocates the memory space to the executable module in the main memory and then transfers control to the beginning instruction of the program 



The correct answer is:
translation
Q: There is a new data-type that can take as values natural numbers between (and including) 0 and 25. How many minimum bits are required to store this datatype?
A. 4
B. 3
C. 6
D. 5
Solution: The correct answer is:
5
Q: In Object oriented paradigm, this process of hiding the implementation from the user, so that he/she is aware only of what the application does and not how it does it is called?
A. Overloading
B. Abstraction
C. Polymorphism
D. Inheritance
Solution: The correct answer is:
Abstraction
Q: Eesha is developing a word processor in which she wants to implement the “autocomplete” feature. With this feature, as and when we start typing a word, the word processor will suggest the rest of the word. To implement this, what data structure is most suitable?
A. tree
B. array
C. list
D. stack
Solution: A tree is a nonlinear data structure, compared to arrays, linked lists, stacks, and queues which are linear data structures. A tree can be empty with no nodes or a tree is a structure consisting of one node called the root and zero or one or more subtrees.

The correct answer is:
 tree
Q: #include > stdio.h >
int main()
{
int a[5] = {5,1,15,20,25};
int i,j,m;
i= ++a[1];
j= a[1]++;
m =a[i++];
printf("%d, %d", i,j,m);
return 0;
}
A. 2, 3, 20
B. 3, 2, 15
C. 1, 2, 5
D. 2, 1, 15
Solution: The correct answer is:
3, 2, 15
Q: A data type is stored as a 6 bit signed integer. Which of the following cannot be represented by this data type?
A. 0
B. 18
C. 10
D. 32
Solution: The correct answer is:
32

You Have Score    /8